
<!-- 帆软BI及报表展示 -->
<template>
  <div class="link-home">
    <div id="iframe-container">
      <iframe :src="link" scrolling="auto"  frameborder="0" id="childIframe"></iframe>
    </div>
  </div>
</template>

<script>
//import NProgress from 'nprogress'
// 发送TOKEN给子模块通过JWT验收信息
// window.onload = function(){
// }
export default {
	data() {
	    return {
	        title: "",
			    link: ""
	    }
	 },
  mounted() {
		
    // alert(this.$route.meta.title)
    var token = window.sessionStorage.getItem("token")
    this.link = this.$route.meta.link+"?token="+encodeURIComponent(token);
    this.title = this.$route.meta.title;
    // setTimeout(function(){
    //   let iframe = document.getElementById('childIframe')
    //   iframe.contentWindow.postMessage(token,"*")
    // },300);
    
	},
  activated() {
    
    // alert(this.$route.meta.title)
    var token = window.sessionStorage.getItem("token")
    this.link = this.$route.meta.link+"?token="+encodeURIComponent(token);
    this.title = this.$route.meta.title;
    // setTimeout(function(){
    //   let iframe = document.getElementById('childIframe')
    //   iframe.contentWindow.postMessage(token,"*")
    // },300);
    
  },
  watch: {
    $route: function (to) {
      console.log(to);
      this.link = this.$route.meta.link;
     
    }
     
  },
  methods: {
  }
}
</script>
<style lang="less" scoped>
.link-home{
  width: 100%;
  height: 100%;
}
#iframe-container{
  width: 100%;
  height: 100%;
}
#childIframe{
  width: 100%;
  height: 100%;
}
</style>